<?php
/**
 * This file is lil-wide view file. 
 *
 * @copyright     Copyright 2008-2010, LilCake.net
 * @link          http://lilcake.net LilCake.net
 * @package       lil
 * @subpackage    lil
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
/**
 * LilPdfView view class
 *
 * @package       lil
 * @subpackage    lil
 */
class LilPdfView extends View {
/**
 * Plugin Name
 *
 * @var pluginName
 */
	private $pluginName = null;
/**
 * Pdf handled
 *
 * @var _pdf
 */
	private $_pdf = null;
/**
 * Constructor
 *
 * @param Controller $controller A controller object to pull View::__passedArgs from.
 */
	public function __construct($controller) {
		App::uses('LilPluginRegistry', 'Lil.Lib');
		
		$this->callPluginHandlers('before_construct_pdf_view');
		parent::__construct($controller);
		
		$this->callPluginHandlers('after_construct_pdf_view');
	}
/**
 * __call method
 *
 * @param mixed $method
 * @param mixed $params
 * @access private
 * @return void
 */
	function __call($method, $params) {
		if (!is_null($this->_pdf) && is_callable(array($this->_pdf, $method))) {
			return (call_user_func_array(array($this->_pdf, $method), $params));
		}
		return false;
	}
/**
 * setPdf method
 *
 * @return mixed
 */
	public function setPdf($pdf) {
		$this->_pdf = $pdf;
	}
/**
 * callPluginHandlers method
 *
 * @return mixed
 */
	public function callPluginHandlers($handler, $data = null) {
		$registry = LilPluginRegistry::getInstance();
		return $registry->callPluginHandlers($this, $handler, $data);
	}
}